package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseIdReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseListResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BasePageResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.planorder.*;
import com.zmj.sy.mom.srv.aps.service.PlanOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@Api(tags = "生产策划-焊接平衡")
@RequiredArgsConstructor
@RestController
@RequestMapping("/planOrderWelding")
public class PlanOrderWeldingController {

    private final PlanOrderService planOrderService;

    @ApiOperation("焊接平衡-新增")
    @PostMapping("/add")
    public BaseResVo add(@RequestBody PlanOrderWeldingAddReqVo reqVo) {
        planOrderService.add(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("焊接平衡-列表")
    @GetMapping("/list")
    public BasePageResVo<PlanOrderWeldingListResVo> list(PlanOrderWeldingListReqVo reqVo) {
        return planOrderService.list(reqVo);
    }

    @ApiOperation("焊接平衡-详情")
    @GetMapping("/detail")
    public PlanOrderWeldingDetailResVo detail(BaseIdReqVo reqVo) {
        return planOrderService.detail(reqVo);
    }

    @ApiOperation("焊接平衡-更新")
    @PostMapping("/edit")
    public BaseResVo edit(@RequestBody PlanOrderWeldingEditReqVo reqVo) {
        planOrderService.edit(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("焊接平衡-下拉框")
    @GetMapping("/select")
    public BaseListResVo<PlanOrderWeldingSelectResVo> select(PlanOrderWeldingSelectReqVo reqVo) {
        return planOrderService.select(reqVo);
    }

    @ApiOperation("焊接平衡-添加列")
    @PostMapping("/addColumn")
    public BaseResVo addColumn(@RequestBody PlanOrderWeldingAddColumnReqVo reqVo) {
        planOrderService.addColumn(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("焊接平衡-删除列")
    @PostMapping("/delColumn")
    public BaseResVo delColumn(@RequestBody PlanOrderWeldingDelColumnReqVo reqVo) {
        planOrderService.delColumn(reqVo);
        return BaseResVo.ok();
    }

}
